$OpenBSD: patch-plugins_node_d_openbsd_if_errcoll__in,v 1.2 2012/10/12 09:46:46 kirby Exp $
--- plugins/node.d.openbsd/if_errcoll_.in.orig	Fri Aug 31 19:22:50 2012
+++ plugins/node.d.openbsd/if_errcoll_.in	Sun Sep 30 23:19:21 2012
@@ -4,9 +4,9 @@
 # Wildcard-plugin to monitor network interfaces. To monitor an
 # interface, link if_<interface> to this file. E.g.
 #
-#    ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0
+#    ln -s /usr/share/munin/node/plugins-auto/if_errcoll_ /etc/munin/node.d/if_errcoll_em0
 #
-# ...will monitor eth0.
+# ...will monitor em0.
 #
 # Any device found in /usr/bin/netstat can be monitored.
 #
@@ -30,7 +30,7 @@ fi
 
 if [ "$1" = "suggest" ]; then
 	if [ -x /usr/bin/netstat ]; then
-		netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link#[0-9]*>/s/\** .*//p'
+		netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link>/s/\** .*//p'
 		exit 0
 	else
 		exit 1
@@ -53,15 +53,15 @@ if [ "$1" = "config" ]; then
 	exit 0
 fi;
 
-/usr/bin/netstat -i -b -n -I $INTERFACE | awk '
-/<Link#[0-9]*>/ {
-	if (NF == 10) {
+/usr/bin/netstat -i -n -I $INTERFACE | awk '
+/<Link>/ {
+	if (NF == 8) {
 		print "ierrors.value", $5;
-		print "oerrors.value", $8;
-		print "collisions.value", $10;
+		print "oerrors.value", $7;
+		print "collisions.value", $8;
 	} else {
 		print "ierrors.value", $6;
-		print "oerrors.value", $9;
-		print "collisions.value", $11;
+		print "oerrors.value", $8;
+		print "collisions.value", $9;
 	}
 }'
